﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace JuCheap.Core.Data.Migrations
{
    public partial class change_models : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "HourOfWorks",
                table: "TimePeriods",
                newName: "TimeTypePeriod");

            migrationBuilder.RenameColumn(
                name: "DayOfWorks",
                table: "TimePeriods",
                newName: "TimeStart");

            migrationBuilder.AddColumn<int>(
                name: "RemoteId",
                table: "Workers",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "TimeEnd",
                table: "TimePeriods",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DateEnd",
                table: "PaiBans",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "DateStart",
                table: "PaiBans",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "Direction",
                table: "HardWareDevices",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "Location",
                table: "HardWareDevices",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "RemoteId",
                table: "Workers");

            migrationBuilder.DropColumn(
                name: "TimeEnd",
                table: "TimePeriods");

            migrationBuilder.DropColumn(
                name: "DateEnd",
                table: "PaiBans");

            migrationBuilder.DropColumn(
                name: "DateStart",
                table: "PaiBans");

            migrationBuilder.DropColumn(
                name: "Direction",
                table: "HardWareDevices");

            migrationBuilder.DropColumn(
                name: "Location",
                table: "HardWareDevices");

            migrationBuilder.RenameColumn(
                name: "TimeTypePeriod",
                table: "TimePeriods",
                newName: "HourOfWorks");

            migrationBuilder.RenameColumn(
                name: "TimeStart",
                table: "TimePeriods",
                newName: "DayOfWorks");
        }
    }
}
